package com.project.thread.demo;

public class MyThreadOne implements Runnable {
    private String name ;

    public MyThreadOne(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println(name+ "正在执行");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

//    private String name;
//
//    public MyThreadOne(String name) {
//        this.name = name;
//    }
//    @Override
//    public void run() {
//        for (int i = 0; i < 10; i++) {
//            System.out.println(Thread.currentThread().getName() + "运行,i= " + i);
//        }
//    }
}
